import { Image,View, StyleSheet,Text,Switch,TouchableOpacity,Button } from 'react-native';

import { HelloWave } from '@/components/HelloWave';
import React from 'react';
import { Link,useRouter } from "expo-router";

export default function HomeScreen() {
  let [state,setState]=React.useState(false)
  let two=()=>{
    alert('双击666')
  }
  let nav=useRouter()
  return (
    <View style={{backgroundColor:'white'}}>
        <Text>Welcome!韩天宝2212</Text>
        <Text style={[styles.textStyle,styles.text2]}>哈哈哈哈哈</Text>
        <Text numberOfLines={1} style={[styles.textStyle,styles.text2]}>哈哈ajksdlkljsaljadkljjkasdljkasdlasdljkasdljkasdljkasdljkasdljlkasd哈哈哈</Text>
        
        <HelloWave />
        <Text>{'\n\n\n'}</Text>
        <Text onLongPress={()=>alert('韩天宝')} style={styles.textStyle}>长按~</Text>
        <Text onPress={()=>alert('韩天宝')} style={styles.textStyle}>单点~</Text>
        <View accessible={true} onMagicTap={()=>two()} style={styles.textStyle}>
          <Text>双指触摸~</Text>
        </View>
        <Text selectable style={styles.textStyle}>长按复制~</Text>
        <Text>{state?"true":"false"}</Text>
        <Switch value={state} onValueChange={(e)=>{setState(e)}}></Switch>
        <TouchableOpacity>
          <Text>触摸</Text>
        </TouchableOpacity>
        <Link href="/login">
          <Text>跳转</Text>
        </Link>
      <Button title='跳转' onPress={()=>nav.push('/login')}></Button>

        {/* <Image style={styles.img1}
        source={"https://img0.baidu.com/it/u=1153787014,2280321911&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=800"}
        ></Image> */}

    </View>
  );
}

const styles = StyleSheet.create({
  img1:{
    width:100,
    height:100
  },
  textStyle: {
    fontSize: 50,
    marginBottom: 8,
    color: 'black',
  },
  titleContainer: {
    flexDirection: 'row',
    alignItems: 'center',
    gap: 8,
  },
  text2:{
    color:'red',
  }
});
